// Linux resources implementation
// Copyright 2006 (C) Ralph Thomas

#include <util/resources.h>
#include <stdlib.h>
#include <binreloc.h>
#include <boost/filesystem/operations.hpp>
#include <iostream>

namespace bfs = boost::filesystem;

namespace util {
	bfs::path getMissionPath() {
		//
		// If the user has a custom mission environment set up
		// then use that. This is handy for development purposes.
		//
		bfs::path mp( getenv( "HOME" ), bfs::native );
		mp /= bfs::path( ".mission", bfs::native );
		if( bfs::exists( mp ) ) return mp;
		char* data_path( br_find_data_dir( "/usr/local/share" ) );
		mp = bfs::path( data_path, bfs::native );
		free( data_path );
		mp /= bfs::path( "mission", bfs::native );
		return mp;
	}
	bfs::path getThumbnailPath() {
		bfs::path mp( getenv( "HOME" ), bfs::native );
		mp /= bfs::path( ".thumbnails", bfs::native );
		return mp;
	}
};

